home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_conesideambients.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  125 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_ConeSideAmbients.cog
  4. #
  5. # Produces random ambient cave sounds when crossing adjoins
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC]  modified 12/3 by [CMG]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.  
  16.     #................MESSAGES........................
  17.     message     startup
  18.     message     crossed
  19.     message     pulse
  20.     
  21.     #................ACTORS..........................
  22.     thing        player                                local
  23.     
  24.     
  25.     #................TRIGGERS........................
  26.     surface       oncross               linkID=2
  27.     surface       oncross1              linkID=2
  28.     
  29.     surface       offcross              linkID=3
  30.     surface       offcross1             linkID=3
  31.     
  32.             
  33.     #................SOUNDS........................
  34.     sound       sndCave0=tem_wind04_c.wav            local
  35.     sound       sndCave1=olv_outside_a01.wav        local
  36.     sound       sndCave2=olv_outside_a04.wav        local
  37.     sound       sndCave3=tem_wind02_c.wav              local
  38.     sound       sndCave4=olv_outside_a08.wav          local
  39.     sound       sndCave5=shw_birds.wav                local
  40.         
  41.     #................VARIABLES........................
  42.     
  43.     float       caveFreq                            local
  44.     
  45.     flex        pulseTime                            local
  46.     flex        vol=1.0                                local
  47.     
  48. end
  49.  
  50. # ========================================================================================
  51.  
  52. code
  53.  
  54. startup:
  55.  
  56.     player = GetLocalPlayerThing();
  57.  
  58. return;
  59.  
  60.  
  61. # ========================================================================================
  62. crossed:
  63.  
  64.     If ((GetSenderID() == 2) && (GetSourceref() == player))
  65.             {
  66.             pulseTime=RandBetween(4, 12);
  67.             SetPulse(pulseTime);
  68.             }
  69.     
  70.     If ((GetSenderID() == 3) && (GetSourceref() == player))
  71.             {
  72.             SetPulse(0);
  73.             }
  74.  
  75. return;
  76. # ========================================================================================
  77. pulse:
  78.  
  79.         pulseTime=RandBetween(4, 8);
  80.         SetPulse(pulseTime);
  81.  
  82.     
  83.         # check if indy is swimming, if so reset the pusle then drop out
  84.         if (GetMoveStatus(player) == 12) return;
  85.     
  86.  
  87.     caveFreq = Rand();
  88.  
  89.     if (caveFreq < 0.16)
  90.         {
  91.             PlaySoundLocal(sndCave0, vol, 1, 0, 0);
  92.         }
  93.         
  94.     if ((caveFreq > 0.16) && (caveFreq < 0.32))
  95.         {
  96.             PlaySoundLocal(sndCave1, vol, 1, 0, 0);
  97.         }
  98.         
  99.     if ((caveFreq > 0.32) && (caveFreq < 0.48))
  100.         {
  101.             PlaySoundLocal(sndCave2, 0.25, -1, 0, 0);
  102.         }
  103.     
  104.     if ((caveFreq > 0.48) && (caveFreq < 0.64))
  105.         {
  106.             PlaySoundLocal(sndCave3, vol, 1, 0, 0);
  107.         }
  108.     
  109.     if ((caveFreq > 0.64) && (caveFreq < 0.80))
  110.         {
  111.             PlaySoundLocal(sndCave4, 0.25, 0, 0, 0);
  112.         }
  113.     
  114.     if ((caveFreq > 0.80) && (caveFreq < 0.96))
  115.         {
  116.             PlaySoundLocal(sndCave5, 0.1, -1, 0, 0);
  117.         }
  118.         
  119.         return;
  120.     
  121. return;
  122. # ========================================================================================
  123.         
  124. end
  125.